import {useNavigation} from "@react-navigation/native"
import {NativeStackNavigationProp} from "@react-navigation/native-stack"
type RootStackParamList = {
  Demo: undefined
  Login: undefined
  UserInfo: undefined
  Tabbar: undefined
  TanHua: undefined
  Search: undefined
  TestSoul: undefined
  TestQA: undefined
  TestResult: undefined
  Detail: undefined
  Chat: {id: number}
  Comment: undefined
  Publish: undefined
  Follow: undefined
  Trends: undefined
  Visitors: undefined
  UserUpdate: undefined
  Settings: undefined
}
type NavigationProp = NativeStackNavigationProp<RootStackParamList>
import {createNavigationContainerRef} from "@react-navigation/native"

export const navigationRef = createNavigationContainerRef<RootStackParamList>()
export const useTHNavigation = () => {
  const navigation = useNavigation<NavigationProp>()
  return navigation
}
